<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>

		<link rel="stylesheet"
			href="${pageContext.request.contextPath}/css/base.css" />
		<link rel="stylesheet"
			href="${pageContext.request.contextPath}/css/info-reg.css" />
		<title>财务报表填写</title>
		<script type="text/javascript"
			src="${pageContext.request.contextPath }/js/jquery.js"></script>
		<script type="text/javascript">
	showRemind('input[type=text], textarea', 'placeholder');

	function previewImg() {
		var fileObj = document.getElementById("finFile_id");
		var Fin_File = fileObj.value;

	}

	function checkData() {
		if ($("#fincash_id").val() != null && $("#fincash_id").val()!="") {
			var div_1 = document.getElementById("div_1");
			div_1.style.display = 'none';
		}else{
			 div_1 = document.getElementById("div_1");
			div_1.style.display = 'block';
			
		}
		if ($("#deptName_id").val()!= null && $("#deptName_id").val()!="-请选择-") {
			var div_2 = document.getElementById("div_2");
			div_2.style.display = 'none';
		}else{
		var div_2 = document.getElementById("div_2");
			div_2.style.display = 'block';
		}
		if ($("#finType_id").val()!= null && $("#finType_id").val()!="-请选择-") {
			var div_3 = document.getElementById("div_3");
			div_3.style.display = 'none';
		}else{
			var div_3 = document.getElementById("div_3");
			div_3.style.display = 'block';
		}
		
		if ($("#finDetail_id").val()!= null && $("#finDetail_id").val()!="") {
			var div_4 = document.getElementById("div_4");
			div_4.style.display = 'none';
		}else{
		var div_4 = document.getElementById("div_4");
			div_4.style.display = 'block';
		}
		if ($("#finFile_id").val()!= null && $("#finFile_id").val()!="") {
			var div_5 = document.getElementById("div_5");
			div_5.style.display = 'none';
		}else{
		var div_5 = document.getElementById("div_5");
			div_5.style.display = 'block';
		}
		
	}
	function check(){
	
	    if($("#fincash_id").val()!=""&&$("#deptName_id").val()!="-请选择-"&&
	    $("#finType_id").val()!="-请选择-"&&$("#finDetail_id").val()!=""&&
	    $("#finFile_id").val()!=""
	    ){
	   
	    var btnsave=document.getElementById("btnsave_id");
	   $("#btnsave_id").attr("disabled",false);
	    }else{
	    $("#btnsave_id").attr("disabled",true);
	    }
	}
</script>
		<style type="text/css">
td {
	font-size: 15px;
}

body {
	background-image:
		url(${pageContext.request.contextPath}/images/forum6.jpg);
}
</style>
	</head>

	<body>
	
		<div class="title">
			<h2>
				财务报表信息登记
			</h2>
		</div>
		<div class="main" align="center">

			<form action="${pageContext.request.contextPath}/financeManager.action?method=savefinance" method="post" enctype="multipart/form-data">
				<table align="center" cellpadding="0" cellspacing="0" border="0"
					width="80%">
					<tr>
						<td colspan="2">
							<h2 style="font-size: 20px;">
								请编辑以下财务报表信息
							</h2>
						</td>
					</tr>
					<tr class="short-input ue-clear">
						<td>
							<br />
							<br>
							<br />
							操作编号：
						</td>
						<td>
							<br />
							<br />
							<input type="text" name="Fin_Id" / value="自动生成中...."
								readonly="readonly">
						</td>

					</tr>
					<tr class="short-input ue-clear">
						<td>
							<br>
							操作金额：
						</td>
						<td>
							<br>
							<input type="text" name="Fin_Cash" id="fincash_id" onblur="checkData();" onmouseout="check();"/>
						</td>
						<td>
							<div id="div_1" style="color: red;display: block;">
								请输入正确的操作金额!
							</div>

						</td>
					</tr>
					<tr class="short-input ue-clear">
						<td>
							<br>
							部门名称：
						</td>
						<td>
							<br />
							<select name="Dept_Name" id="deptName_id" onblur="checkData();" onmouseout="check();">
								<option value="-请选择-">
									-请选择-
								</option>
								<option value="财务部">
									财务部
								</option>
								<option value="人力资源部">
									人力资源部
								</option>
								<option value="市场部">
									市场部
								</option>
								<option value="研发部">
									研发部
								</option>
								<option value="后勤部">
									后勤部
								</option>
								<option value="总经理办公室">
									总经理办公室
								</option>
							</select>

						</td>
						<td>
							<div id="div_2" style="color: red;">
								请选择正确的部门名称!
							</div>
						</td>
					</tr>
					<tr class="long-input ue-clear">
						<td>
							<br />
							操作类型：
						</td>
						<td>
							<br />
							<select name="Fin_Type" id="finType_id" onblur="checkData();" onmouseout="check();">
								<option value="-请选择-">
									-请选择-
								</option>
								<option value="项目报销">
									项目报销表
								</option>
								<option value="工资申请">
									工资申请表
								</option>
								<option value="资产负债表">
									资产负债表
								</option>
								<option value="损益表">
									损益表
								</option>
								<option value="利润表">
									利润表
								</option>
								<option value="利润分配表">
									利润分配表
								</option>
								<option value="财务状况变动表">
									财务状况变动表
								</option>
								<option value="其他">
									其他
								</option>
							</select>
						</td>
						<td>
							<div id="div_3" style="color: red;">
								请选择正确的操作类型!
							</div>
						</td>
					</tr>
					<tr class="long-input ue-clear">
						<td>
							<br />
							财务详情：
						</td>
						<td>
							<br />
							<textarea rows="3" cols="15" name="Fin_Detail" id="finDetail_id" onblur="checkData();" onmouseout="check();"></textarea>
						</td>
						<td>
							<div id="div_4" style="color: red;">
								请编辑财务详情!
							</div>
						</td>
					</tr>

					<tr class="long-input ue-clear">
						<td>
							<br />
							携带附件：
						</td>
						<td>
							<br />
							<input type="file" name="Fin_File" id="finFile_id"
								accept=".docx,.doc,.txt" onchange="previewImg();" onblur="checkData();" onmouseout="check();"/>
						</td>
						<td>
							<div id="div_5" style="color: red;">
								请上传所需携带附件!
							</div>
						</td>
					</tr>
					<tr class="long-input ue-clear">
						<td align="left">
							<br />
							<input type="submit"
								style="background-color: green; width: 100px;" value="确定"
								disabled id="btnsave_id"/>
						</td>
						<td align="right">
							<br />
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

							<input type="reset"
								style="background-color: white; width: 100px;" value="清空内容" onmouseout="checkData();"/>
						</td>
					</tr>
				</table>
			</form>
		</div>

		</div>
	</body>
</html>
